<?php
if (!defined('SMF'))
	die('Hacking attempt...');

global $smcFunc, $txt, $scripturl, $settings, $user_info;
global $dbtables;

// Verify user login, if CheckLogin() returns false return to the calling script/function
if (CheckLogin() == false)
	return;

//-------------------------------------------------------------------------------------------------

// Pull player info into $playerinfo.
$result = $smcFunc['db_query']('', '
	SELECT *
	FROM {raw:db_ships}
	WHERE user_id = {int:user_id}
	LIMIT 1',
	array(
		'db_ships' => $dbtables['ships'],
		'user_id' => $user_info['id'],
	)
);
$playerinfo = $smcFunc['db_fetch_assoc']($result);
$smcFunc['db_free_result']($result);

$armor_pts_max = NUM_ARMOUR($playerinfo['armor']);
$ship_fighters_max = NUM_FIGHTERS($playerinfo['computer']);
$torps_max = NUM_TORPEDOES($playerinfo['torp_launchers']);
$escape_pod = ($playerinfo['dev_escapepod'] == 'Y') ? $txt['bnt_yes'] : $txt['bnt_no'];

echo '
						<div id="rightmenu">
							<ul class="rightmenu_rounded">
								<li class="rightmenu_header">', $txt['bnt_cargo'], '</li>
								<li class="rightmenu_title"><img class="cargo_icon" alt="" src="', $settings['images_url'], '/bnt/ore.gif">', $txt['bnt_ore'], '</li>
								<li id="cargo_ore" class="rightmenu_data">', NUMBER($playerinfo['ship_ore']), '</li>
								<li class="rightmenu_title"><img class="cargo_icon" alt="" src="', $settings['images_url'], '/bnt/organics.gif">', $txt['bnt_organics'], '</li>
								<li id="cargo_organics" class="rightmenu_data">', NUMBER($playerinfo['ship_organics']), '</li>
								<li class="rightmenu_title"><img class="cargo_icon" alt="" src="', $settings['images_url'], '/bnt/goods.gif">', $txt['bnt_goods'], '</li>
								<li id="cargo_goods" class="rightmenu_data">', NUMBER($playerinfo['ship_goods']), '</li>
								<li class="rightmenu_title"><img class="cargo_icon" alt="" src="', $settings['images_url'], '/bnt/energy.gif">', $txt['bnt_energy'], '</li>
								<li id="cargo_energy" class="rightmenu_data">', NUMBER($playerinfo['ship_energy']), '</li>
								<li class="rightmenu_title"><img class="cargo_icon" alt="" src="', $settings['images_url'], '/bnt/colonists.gif">', $txt['bnt_colonists'], '</li>
								<li id="cargo_colonists" class="rightmenu_data">', NUMBER($playerinfo['ship_colonists']), '</li>
								<li class="rightmenu_title"><img class="cargo_icon" alt="" src="', $settings['images_url'], '/bnt/credits.gif">', $txt['bnt_credits'], '</li>
								<li id="cargo_credits" class="rightmenu_data">', NUMBER($playerinfo['credits']), '</li>
							</ul>
						</div>
						<div id="rightmenu">
							<ul class="rightmenu_rounded">
								<li class="rightmenu_header">Armament</li>
								<li class="rightmenu_title">', $txt['bnt_armorpts'], '</li>
								<li class="rightmenu_data"><span id="armament_armor">', NUMBER($playerinfo['armor_pts']), '</span> / ', NUMBER($armor_pts_max), '</li>
								<li class="rightmenu_title">', $txt['bnt_fighters'], '</li>
								<li class="rightmenu_data"><span id="armament_fighters">', NUMBER($playerinfo['ship_fighters']), '</span> / ',  NUMBER($ship_fighters_max), '</li>
								<li class="rightmenu_title">', $txt['bnt_torps'], '</li>
								<li class="rightmenu_data"><span id="armament_torps">', NUMBER($playerinfo['torps']), '</span> / ', NUMBER($torps_max), '</li>
								<li id="armament_deflect" class="rightmenu_title">', $txt['bnt_deflect'], '</li>
								<li class="rightmenu_data">', NUMBER($playerinfo['dev_minedeflector']), '</li>
								<li id="armament_ewd" class="rightmenu_title">', $txt['bnt_ewdabbr'], '</li>
								<li class="rightmenu_data">', $playerinfo['dev_emerwarp'], '</li>
								<li id="armament_escapepod" class="rightmenu_title">', $txt['bnt_escape_pod'], '</li>
								<li class="rightmenu_data">', $escape_pod, '</li>
							</ul>
						</div>
						<script>
							$(\'.rightmenu_rounded\').corners("top-right bottom-right transparent no-native");
						</script>';
?>